.class public Lrexsee/core/animation/Rotate3dxAnimation;
.super Landroid/view/animation/Animation;
.source "Rotate3dxAnimation.java"


# instance fields
.field private mCamera:Landroid/graphics/Camera;

.field private mCenterX:F

.field private mCenterY:F

.field private final mDepthZ:F

.field private final mFromDegrees:F

.field private mPivotXType:I

.field private mPivotXValue:F

.field private mPivotYType:I

.field private mPivotYValue:F

.field private final mReverse:Z

.field private final mToDegrees:F


# direct methods
.method public constructor <init>(FFFZIFIF)V
    .locals 2
    .param p1, "fromDegrees"    # F
    .param p2, "toDegrees"    # F
    .param p3, "depthZ"    # F
    .param p4, "reverse"    # Z
    .param p5, "pivotXType"    # I
    .param p6, "pivotXValue"    # F
    .param p7, "pivotYType"    # I
    .param p8, "pivotYValue"    # F

    .prologue
    const/4 v1, 0x0

    const/4 v0, 0x0

    .line 40
    invoke-direct {p0}, Landroid/view/animation/Animation;-><init>()V

    .line 35
    iput v1, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mPivotXType:I

    .line 36
    iput v1, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mPivotYType:I

    .line 37
    iput v0, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mPivotXValue:F

    .line 38
    iput v0, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mPivotYValue:F

    .line 42
    iput p1, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mFromDegrees:F

    .line 43
    iput p2, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mToDegrees:F

    .line 44
    iput p3, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mDepthZ:F

    .line 45
    iput-boolean p4, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mReverse:Z

    .line 46
    iput p6, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mPivotXValue:F

    .line 47
    iput p5, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mPivotXType:I

    .line 48
    iput p8, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mPivotYValue:F

    .line 49
    iput p7, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mPivotYType:I

    .line 50
    return-void
.end method


# virtual methods
.method protected applyTransformation(FLandroid/view/animation/Transformation;)V
    .locals 9
    .param p1, "interpolatedTime"    # F
    .param p2, "t"    # Landroid/view/animation/Transformation;

    .prologue
    const/4 v8, 0x0

    .line 63
    iget v4, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mFromDegrees:F

    .line 64
    .local v4, "fromDegrees":F
    iget v6, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mToDegrees:F

    sub-float/2addr v6, v4

    mul-float/2addr v6, p1

    add-float v3, v4, v6

    .line 66
    .local v3, "degrees":F
    iget v1, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mCenterX:F

    .line 67
    .local v1, "centerX":F
    iget v2, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mCenterY:F

    .line 68
    .local v2, "centerY":F
    iget-object v0, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mCamera:Landroid/graphics/Camera;

    .line 70
    .local v0, "camera":Landroid/graphics/Camera;
    invoke-virtual {p2}, Landroid/view/animation/Transformation;->getMatrix()Landroid/graphics/Matrix;

    move-result-object v5

    .line 72
    .local v5, "matrix":Landroid/graphics/Matrix;
    invoke-virtual {v0}, Landroid/graphics/Camera;->save()V

    .line 73
    iget-boolean v6, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mReverse:Z

    if-eqz v6, :cond_0

    .line 74
    iget v6, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mDepthZ:F

    mul-float/2addr v6, p1

    invoke-virtual {v0, v8, v8, v6}, Landroid/graphics/Camera;->translate(FFF)V

    .line 78
    :goto_0
    invoke-virtual {v0, v3}, Landroid/graphics/Camera;->rotateX(F)V

    .line 79
    invoke-virtual {v0, v5}, Landroid/graphics/Camera;->getMatrix(Landroid/graphics/Matrix;)V

    .line 80
    invoke-virtual {v0}, Landroid/graphics/Camera;->restore()V

    .line 82
    neg-float v6, v1

    neg-float v7, v2

    invoke-virtual {v5, v6, v7}, Landroid/graphics/Matrix;->preTranslate(FF)Z

    .line 83
    invoke-virtual {v5, v1, v2}, Landroid/graphics/Matrix;->postTranslate(FF)Z

    .line 85
    return-void

    .line 76
    :cond_0
    iget v6, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mDepthZ:F

    const/high16 v7, 0x3f800000    # 1.0f

    sub-float/2addr v7, p1

    mul-float/2addr v6, v7

    invoke-virtual {v0, v8, v8, v6}, Landroid/graphics/Camera;->translate(FFF)V

    goto :goto_0
.end method

.method public initialize(IIII)V
    .locals 2
    .param p1, "width"    # I
    .param p2, "height"    # I
    .param p3, "parentWidth"    # I
    .param p4, "parentHeight"    # I

    .prologue
    .line 54
    invoke-super {p0, p1, p2, p3, p4}, Landroid/view/animation/Animation;->initialize(IIII)V

    .line 55
    iget v0, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mPivotXType:I

    iget v1, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mPivotXValue:F

    invoke-virtual {p0, v0, v1, p1, p3}, Lrexsee/core/animation/Rotate3dxAnimation;->resolveSize(IFII)F

    move-result v0

    iput v0, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mCenterX:F

    .line 56
    iget v0, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mPivotYType:I

    iget v1, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mPivotYValue:F

    invoke-virtual {p0, v0, v1, p2, p4}, Lrexsee/core/animation/Rotate3dxAnimation;->resolveSize(IFII)F

    move-result v0

    iput v0, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mCenterY:F

    .line 57
    new-instance v0, Landroid/graphics/Camera;

    invoke-direct {v0}, Landroid/graphics/Camera;-><init>()V

    iput-object v0, p0, Lrexsee/core/animation/Rotate3dxAnimation;->mCamera:Landroid/graphics/Camera;

    .line 58
    return-void
.end method
